Page({
  data:{
    title:''
  },
  input(e){
    console.log(e)
    this.setData({
      title:e.detail.value
    })
  },
  search(){
    wx.navigateTo({
      url:'search?title='+this.data.title,
    })
  },
  onLoad: function(options) {
    var that = this
    //请求电影数据
    wx: wx.request({
      url: 'http://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items?count=8',
      success: function(res) {
        console.log(res)
        var movies = res.data.subject_collection_items
        that.setData({
          movies: movies
        })
      }
    })
    //请求电视数据
    wx.request({
     url: 'http://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items?count=8',
      success: function(res) {
       //console.log(res)
       var tvs=res.data.subject_collection_items
       that.setData({
         tvs:tvs
       })
     },
   })
    //请求综艺数据
wx.request({
    url: 'http://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items?count=8',
      success:function(res){
        //console.log(res)
        var shows=res.data.subject_collection_items
        that.setData({
          shows:shows
        })
      }
    })

    
  },
  
})